/* Copyright (c) 2012, Roberto Javier Godoy.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Please contact Roberto Javier Godoy at <rjgodoy@fich.unl.edu.ar>,
 * <mail@rjgodoy.com.ar> if you need additional information or have any
 * questions.
 */
package ar.com.rjgodoy.sgml.sax;

import org.xml.sax.SAXException;

/**
 *
 * <P style="color:red;font-weight:bold">WARNING: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE</P>
 *
 * @author Roberto Javier Godoy
 *
 */
public interface SGMLLexicalHandler {

	/**Report the start of a  <I>marked section declaration</I>[<A href="http://xml.coverpages.org/sgmlsyn/sgmlsyn.htm#P93">93</A>].
	 *
	 * <p>If the effective status of the marked section is CDATA,
	 * and a {@code LexicalHandler} is attached to the parser,
	 * then {@link org.xml.sax.ext.LexicalHandler#startCDATA()}
	 * will be generated immediatly after processing this event.</p>
	 *
	 * <p>
	 * This event is intended only to report the boundary of the marked section.
	 * The contents of non-IGNOREd marked sections will be reported through regular {@link org.xml.sax.ContentHandler} events.
	 * IGNOREd marked sections will have their contents reported through the {@link #ignoredCharacters(char[], int, int) ignoredCharacters} event
	 * </p>
     *
     * @param status the highest-ranking <I>status keyword</I>[<A href="http://xml.coverpages.org/sgmlsyn/sgmlsyn.htm#P100">100</A>]
     *               of the marked section declaration.
     *               Ranking is defined in Clause 10.4.2 as IGNORE (highest), CDATA, RCDATA and INCLUDE.
     *
     * @param temp   whether the <I>status keyword specification</I>[<A href="http://xml.coverpages.org/sgmlsyn/sgmlsyn.htm#P97">97</A>]
     *               contains TEMP.
     *
     * @throws org.xml.sax.SAXException any SAX exception, possibly wrapping another exception
     * @see #endMarkedSection(MarkedSectionStatus)
	 */
	void startMarkedSection(MarkedSectionStatus status, boolean temp) throws SAXException;

	/**Report the end of a <I>marked section declaration</I>[<A href="http://xml.coverpages.org/sgmlsyn/sgmlsyn.htm#P93">93</A>].
	 *
	 * <p>If the effective status of the marked section is CDATA,
	 * and a {@code LexicalHandler} is attached to the parser,
	 * then {@link org.xml.sax.ext.LexicalHandler#startCDATA()}
	 * will have been generated immediatly before this event.</p>
	 *
	 * @param status the highest-ranking <I>status keyword</I>[<A href="http://xml.coverpages.org/sgmlsyn/sgmlsyn.htm#P100">100</A>]
     *               of the marked section declaration.
     *
     * @throws org.xml.sax.SAXException any SAX exception, possibly wrapping another exception
     * @see #startMarkedSection(MarkedSectionStatus, boolean)
     */
	void endMarkedSection(MarkedSectionStatus status) throws SAXException;;

	/**Report the end of the <I>prolog</I>[<A href="http://xml.coverpages.org/sgmlsyn/sgmlsyn.htm#P7">7</A>].
	 *
	 * @throws org.xml.sax.SAXException any SAX exception, possibly wrapping another exception*/
	void endProlog() throws SAXException;

	/**Generated for a sequence of characters in an ignored marked section in the instance,
	 * but only if the ParserEventGeneratorKit::outputMarkedSections option is enabled.
	 * This is non-ESIS information.*/
	public void ignoredCharacters(char ch[], int start, int length);

}
